package com.btm.easymetadata.server.controller;

import com.btm.easymetadata.server.entity.base.Response;
import com.btm.easymetadata.server.entity.dto.LinkDTO;
import com.btm.easymetadata.server.service.LinkService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/link")
@AllArgsConstructor
public class LinkController {

    private final LinkService linkService;

    @PostMapping("/to")
    public Response<Boolean> linkTo(@RequestBody LinkDTO linkDTO) {
        Response<Boolean> response = new Response<>();
        response.setCode(200);
        response.setData(linkService.linkTo(linkDTO));
        return response;
    }
}
